<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#testdiv {
				width: 400px;
				height: 200px;
				border: 1px solid;
				background-color: #000000;
				position: absolute;
				top: -500px;
				transition:top 1s;
			}
		</style>
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		<script type="text/javascript">
			$(function () {
				$('#opendiv').click(function () {
					$('#testdiv').css('top', '50px');
				})
				$('#closediv').click(function () {
					$('#testdiv').css('top', '-500px');
				})
			})
		</script>
	</head>

	<body>
		<button id="opendiv">显示</button><button id="closediv">关闭</button>
		<div id="testdiv"></div>
	</body>

</html>